<?php
include '../../../common.inc.php';
set_time_limit(0);
include __DIR__ . '/auto.func.php';
$startTime = microtime(true);
// $folder = "F:/Auto/比亚迪/比亚迪e6图片/";
// 3.5s
$folderRoot = "F:/Picture/乘用车/";
$folderRootEncode = mb_convert_encoding($folderRoot,"GB2312","UTF-8,GBK");

// 获取子目录所有分类
$folderRootFirst = getDir($folderRootEncode);
$sql = "insert into xd_auto_handler(first, second, ischeck) values";

foreach($folderRootFirst as $first) {
	$pathEncode = $folderRootEncode.$first.'/';
	$folderRootSecond = getDir($pathEncode);
	$first = _($first);
	if ($folderRootSecond) {
		foreach($folderRootSecond as $second) {
			$second = _($second);
			$sql .= "('$first','$second',0),";
		}
	}
}
print($sql);
exit();